<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="web">
			
		</div>
		<button type="button" name="bt1" onclick="addListener();">添加</button>
		<button type="button" name="bt2"  onclick="removeListener();">清除</button>
	</body>
	<!-- // 实现DIV 鼠标移动事件，采用监听器方式操作，可实现添加和清除监听器功能。 -->
	<script type="text/javascript">
		function addListener(){
			
			document.getElementById('web').removeEventListener('click',SayHello);
			
		}
		
			function SayHello(){
				console.log('hello world')
			}
		function removeListener(){
			document.getElementById('web').removeEventListener('click',SayHello);
		}
	</script>
</html>
